
#ifndef _TSOC_FILTER_
#define _TSOC_FILTER_

#include "Math.hpp"
#include "Color.hpp"


#include <vector>
#include <string>
#include <stdint.h>



namespace com
{
	namespace toxiclabs
	{
		namespace tsoc
		{
			
			
			class Filter
			{
				public:
					uint32_t * cbuffer;
					float * zbuffer;
					int width;
					int height;
					std::string name;
					
					virtual void Init(uint32_t * cbuffer,float * zbuffer,int width,int height)=0;
					
					virtual void Process(int x,int y,int w,int h)=0;
					
					virtual ~Filter();
					
					
			};
			
			class FilterPool
			{
				public:
					static std::vector<Filter *> filters; 
							
				
			};
			
			/*!
			 * Simple fog effect
			 */ 
			class Fog: Filter
			{
				private:
					static Fog instance;
					
					Color fog_color;
					
					Fog();
					~Fog();
					
				public:
				
				
				
				void Init(uint32_t * cbuffer,float * zbuffer,int width,int height);
				void Process(int x,int y,int w,int h);
				
			};
			
			/*!
			 * Simple gamma correction
			 */ 
			class Gamma: Filter
			{
				private:
					static Gamma instance;
					
					Gamma();
					~Gamma();
					
									
				public:
							
					void Init(uint32_t * cbuffer,float * zbuffer,int width,int height);
					void Process(int x,int y,int w,int h);
			};
			
			/*!
			 * DoF filter
			 */ 
			class Dof: Filter
			{
				private:
					//static Dof instance;
					
					Dof();
					~Dof();
					
					std::vector<float> CreateKernel(int radius);
					
									
				public:
							
					void Init(uint32_t * cbuffer,float * zbuffer,int width,int height);
					void Process(int x,int y,int w,int h);
			};
			
		}
	}
}

#endif
